package com.hdu.executor;

import lombok.Data;

@Data
public class RuleHitResult {
    private Rule rule;
    private boolean hit;
    private RunningComplexExpression runningComplexExpression;

    public static RuleHitResult fail(Rule rule) {
        RuleHitResult ruleHitResult = new RuleHitResult();
        ruleHitResult.setRule(rule);
        ruleHitResult.setHit(false);
        return ruleHitResult;
    }

    public static RuleHitResult success(Rule rule, RunningComplexExpression runningComplexExpression) {
        RuleHitResult ruleHitResult = new RuleHitResult();
        ruleHitResult.setRule(rule);
        ruleHitResult.setHit(true);
        ruleHitResult.setRunningComplexExpression(runningComplexExpression);
        return ruleHitResult;
    }

}
